package com.ffyc.ssm.service;

import com.ffyc.ssm.dao.RoleDao;
import com.ffyc.ssm.modle.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;


@Service
public class RoleService {
    @Autowired
    RoleDao roleDao;

    @Transactional
    public List<Role> listRole(Role role){
        return roleDao.getList();
    }

    public void saveRole(Role role) {
        roleDao.saveRole(role);
    }
    @Transactional
    public void deleteRole(Integer id) {
        roleDao.deleteRole(id);
    }

    public Role findrole(Integer id) {
        return roleDao.findrole(id);
    }

    public void updaterole(Map<String, String> map) {
        roleDao.updaterole(map);
    }
}
